<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: cv::cuda::Stream Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="navpath" id="nav-path">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d1/d1a/namespacecv_1_1cuda.html">cuda</a></li><li class="navelem"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">Stream</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="#friends">Friends</a> |
<a href="../../dc/dfd/classcv_1_1cuda_1_1Stream-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::cuda::Stream Class Reference<div class="ingroups"><a class="el" href="../../d1/d1e/group__cuda.html">CUDA-accelerated Computer Vision</a> » <a class="el" href="../../d7/d05/group__cudacore.html">Core part</a> » <a class="el" href="../../d9/d41/group__cudacore__struct.html">Data Structures</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>This class encapsulates a queue of asynchronous calls.  
 <a href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#details">More...</a></p>
<p><code>#include &lt;opencv2/core/cuda.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a9a27b645eaf4c8bf8c73dd7125712b13"><td align="right" class="memItemLeft" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a9a27b645eaf4c8bf8c73dd7125712b13">StreamCallback</a>) (int status, void *userData)</td></tr>
<tr class="separator:a9a27b645eaf4c8bf8c73dd7125712b13"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa6434e2f5f29bd81406732b39951c246"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#aa6434e2f5f29bd81406732b39951c246">Stream</a> ()</td></tr>
<tr class="memdesc:aa6434e2f5f29bd81406732b39951c246"><td class="mdescLeft"> </td><td class="mdescRight">creates a new asynchronous stream  <a href="#aa6434e2f5f29bd81406732b39951c246">More...</a><br/></td></tr>
<tr class="separator:aa6434e2f5f29bd81406732b39951c246"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3da3061ab4b0c737fcb092494b54cec8"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a3da3061ab4b0c737fcb092494b54cec8">Stream</a> (const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../df/d98/classcv_1_1cuda_1_1GpuMat_1_1Allocator.html">GpuMat::Allocator</a> &gt; &amp;allocator)</td></tr>
<tr class="memdesc:a3da3061ab4b0c737fcb092494b54cec8"><td class="mdescLeft"> </td><td class="mdescRight">creates a new asynchronous stream with custom allocator  <a href="#a3da3061ab4b0c737fcb092494b54cec8">More...</a><br/></td></tr>
<tr class="separator:a3da3061ab4b0c737fcb092494b54cec8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5da4a3f60245e71dd298f34991edf940"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a5da4a3f60245e71dd298f34991edf940">Stream</a> (const size_t cudaFlags)</td></tr>
<tr class="memdesc:a5da4a3f60245e71dd298f34991edf940"><td class="mdescLeft"> </td><td class="mdescRight">creates a new <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> using the cudaFlags argument to determine the behaviors of the stream  <a href="#a5da4a3f60245e71dd298f34991edf940">More...</a><br/></td></tr>
<tr class="separator:a5da4a3f60245e71dd298f34991edf940"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a44ee2366e4f4cb8ff5f23e222e9b176b"><td align="right" class="memItemLeft" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a44ee2366e4f4cb8ff5f23e222e9b176b">cudaPtr</a> () const</td></tr>
<tr class="memdesc:a44ee2366e4f4cb8ff5f23e222e9b176b"><td class="mdescLeft"> </td><td class="mdescRight">return Pointer to CUDA stream  <a href="#a44ee2366e4f4cb8ff5f23e222e9b176b">More...</a><br/></td></tr>
<tr class="separator:a44ee2366e4f4cb8ff5f23e222e9b176b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aaad28e33e26b9c19c8d0c87c1d6f733d"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#aaad28e33e26b9c19c8d0c87c1d6f733d">enqueueHostCallback</a> (<a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a9a27b645eaf4c8bf8c73dd7125712b13">StreamCallback</a> callback, void *userData)</td></tr>
<tr class="memdesc:aaad28e33e26b9c19c8d0c87c1d6f733d"><td class="mdescLeft"> </td><td class="mdescRight">Adds a callback to be called on the host after all currently enqueued items in the stream have completed.  <a href="#aaad28e33e26b9c19c8d0c87c1d6f733d">More...</a><br/></td></tr>
<tr class="separator:aaad28e33e26b9c19c8d0c87c1d6f733d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a056a9195ab28d22a0278b092901a2ced"><td align="right" class="memItemLeft" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a056a9195ab28d22a0278b092901a2ced">operator bool_type</a> () const</td></tr>
<tr class="memdesc:a056a9195ab28d22a0278b092901a2ced"><td class="mdescLeft"> </td><td class="mdescRight">returns true if stream object is not default (!= 0)  <a href="#a056a9195ab28d22a0278b092901a2ced">More...</a><br/></td></tr>
<tr class="separator:a056a9195ab28d22a0278b092901a2ced"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9fab618395d42fa31987506e42fab1b4"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a9fab618395d42fa31987506e42fab1b4">queryIfComplete</a> () const</td></tr>
<tr class="memdesc:a9fab618395d42fa31987506e42fab1b4"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the current stream queue is finished. Otherwise, it returns false.  <a href="#a9fab618395d42fa31987506e42fab1b4">More...</a><br/></td></tr>
<tr class="separator:a9fab618395d42fa31987506e42fab1b4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a9e8a713f312a15ba00702d6f46867987"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a9e8a713f312a15ba00702d6f46867987">waitEvent</a> (const <a class="el" href="../../d5/d38/classcv_1_1cuda_1_1Event.html">Event</a> &amp;event)</td></tr>
<tr class="memdesc:a9e8a713f312a15ba00702d6f46867987"><td class="mdescLeft"> </td><td class="mdescRight">Makes a compute stream wait on an event.  <a href="#a9e8a713f312a15ba00702d6f46867987">More...</a><br/></td></tr>
<tr class="separator:a9e8a713f312a15ba00702d6f46867987"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e1d939503e8faad741ab584b720bca6"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a0e1d939503e8faad741ab584b720bca6">waitForCompletion</a> ()</td></tr>
<tr class="memdesc:a0e1d939503e8faad741ab584b720bca6"><td class="mdescLeft"> </td><td class="mdescRight">Blocks the current CPU thread until all operations in the stream are complete.  <a href="#a0e1d939503e8faad741ab584b720bca6">More...</a><br/></td></tr>
<tr class="separator:a0e1d939503e8faad741ab584b720bca6"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a680af5adfeeb1cdaa5b7b13f680c0131"><td align="right" class="memItemLeft" valign="top">static <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">Stream</a> &amp; </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a680af5adfeeb1cdaa5b7b13f680c0131">Null</a> ()</td></tr>
<tr class="memdesc:a680af5adfeeb1cdaa5b7b13f680c0131"><td class="mdescLeft"> </td><td class="mdescRight">return <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> object for default CUDA stream  <a href="#a680af5adfeeb1cdaa5b7b13f680c0131">More...</a><br/></td></tr>
<tr class="separator:a680af5adfeeb1cdaa5b7b13f680c0131"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:af5e88420aa936b283addcc8a6233827e"><td align="right" class="memItemLeft" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#af5e88420aa936b283addcc8a6233827e">BufferPool</a></td></tr>
<tr class="separator:af5e88420aa936b283addcc8a6233827e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab98d52cf0377206238fa449eebe36ab9"><td align="right" class="memItemLeft" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#ab98d52cf0377206238fa449eebe36ab9">DefaultDeviceInitializer</a></td></tr>
<tr class="separator:ab98d52cf0377206238fa449eebe36ab9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8362b5c9fdffe61e694647684353b090"><td align="right" class="memItemLeft" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a8362b5c9fdffe61e694647684353b090">StreamAccessor</a></td></tr>
<tr class="separator:a8362b5c9fdffe61e694647684353b090"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class encapsulates a queue of asynchronous calls. </p>
<dl class="section note"><dt>Note</dt><dd>Currently, you may face problems if an operation is enqueued twice with different data. Some functions use the constant GPU memory, and next call may update the memory before the previous one has been finished. But calling different operations asynchronously is safe because each operation has its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are also safe.</dd>
<dd>
The <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> class is not thread-safe. Please use different <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> objects for different CPU threads.</dd></dl>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> thread1()</div><div class="line">{</div><div class="line">    <a class="code" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">cv::cuda::Stream</a> stream1;</div><div class="line">    cv::cuda::func1(..., stream1);</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> thread2()</div><div class="line">{</div><div class="line">    <a class="code" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">cv::cuda::Stream</a> stream2;</div><div class="line">    cv::cuda::func2(..., stream2);</div><div class="line">}</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>By default all CUDA routines are launched in <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a680af5adfeeb1cdaa5b7b13f680c0131" title="return Stream object for default CUDA stream ">Stream::Null()</a> object, if the stream is not specified by user. In multi-threading environment the stream objects must be passed explicitly (see previous note). </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a9a27b645eaf4c8bf8c73dd7125712b13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a27b645eaf4c8bf8c73dd7125712b13">◆ </a></span>StreamCallback</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* cv::cuda::Stream::StreamCallback) (int status, void *userData)</td>
        </tr>
      </table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aa6434e2f5f29bd81406732b39951c246"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6434e2f5f29bd81406732b39951c246">◆ </a></span>Stream() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::cuda::Stream::Stream </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname"></td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">allocator</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">cudaFlags</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>creates a new asynchronous stream </p>
</div>
</div>
<a id="a3da3061ab4b0c737fcb092494b54cec8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3da3061ab4b0c737fcb092494b54cec8">◆ </a></span>Stream() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::cuda::Stream::Stream </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga6395ca871a678020c4a31fadf7e8cc63">Ptr</a>&lt; <a class="el" href="../../df/d98/classcv_1_1cuda_1_1GpuMat_1_1Allocator.html">GpuMat::Allocator</a> &gt; &amp; </td>
          <td class="paramname"><em>allocator</em></td><td>)</td>
          <td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname"></td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">allocator</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">cudaFlags</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>creates a new asynchronous stream with custom allocator </p>
</div>
</div>
<a id="a5da4a3f60245e71dd298f34991edf940"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5da4a3f60245e71dd298f34991edf940">◆ </a></span>Stream() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::cuda::Stream::Stream </td>
          <td>(</td>
          <td class="paramtype">const size_t </td>
          <td class="paramname"><em>cudaFlags</em></td><td>)</td>
          <td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname"></td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">allocator</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>&lt;cuda_Stream object&gt;</td><td>=</td><td>cv.cuda_Stream(</td><td class="paramname">cudaFlags</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>creates a new <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> using the cudaFlags argument to determine the behaviors of the stream </p>
<dl class="section note"><dt>Note</dt><dd>The cudaFlags parameter is passed to the underlying api cudaStreamCreateWithFlags() and supports the same parameter values. <div class="fragment"><div class="line"><span class="comment">// creates an OpenCV cuda::Stream that manages an asynchronous, non-blocking,</span></div><div class="line"><span class="comment">// non-default CUDA stream</span></div><div class="line"><a class="code" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">cv::cuda::Stream</a> cvStream(cudaStreamNonBlocking);</div></div><!-- fragment --> </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a44ee2366e4f4cb8ff5f23e222e9b176b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44ee2366e4f4cb8ff5f23e222e9b176b">◆ </a></span>cudaPtr()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* cv::cuda::Stream::cudaPtr </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.cuda_Stream.cudaPtr(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>return Pointer to CUDA stream </p>
</div>
</div>
<a id="aaad28e33e26b9c19c8d0c87c1d6f733d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaad28e33e26b9c19c8d0c87c1d6f733d">◆ </a></span>enqueueHostCallback()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cuda::Stream::enqueueHostCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html#a9a27b645eaf4c8bf8c73dd7125712b13">StreamCallback</a> </td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void * </td>
          <td class="paramname"><em>userData</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adds a callback to be called on the host after all currently enqueued items in the stream have completed. </p>
<dl class="section note"><dt>Note</dt><dd>Callbacks must not make any CUDA API calls. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be serialized. </dd></dl>
</div>
</div>
<a id="a680af5adfeeb1cdaa5b7b13f680c0131"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a680af5adfeeb1cdaa5b7b13f680c0131">◆ </a></span>Null()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html">Stream</a>&amp; cv::cuda::Stream::Null </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.cuda.Stream_Null(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>return <a class="el" href="../../d9/df3/classcv_1_1cuda_1_1Stream.html" title="This class encapsulates a queue of asynchronous calls. ">Stream</a> object for default CUDA stream </p>
</div>
</div>
<a id="a056a9195ab28d22a0278b092901a2ced"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a056a9195ab28d22a0278b092901a2ced">◆ </a></span>operator bool_type()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::cuda::Stream::operator bool_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>returns true if stream object is not default (!= 0) </p>
</div>
</div>
<a id="a9fab618395d42fa31987506e42fab1b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fab618395d42fa31987506e42fab1b4">◆ </a></span>queryIfComplete()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::cuda::Stream::queryIfComplete </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.cuda_Stream.queryIfComplete(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Returns true if the current stream queue is finished. Otherwise, it returns false. </p>
</div>
</div>
<a id="a9e8a713f312a15ba00702d6f46867987"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e8a713f312a15ba00702d6f46867987">◆ </a></span>waitEvent()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cuda::Stream::waitEvent </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d5/d38/classcv_1_1cuda_1_1Event.html">Event</a> &amp; </td>
          <td class="paramname"><em>event</em></td><td>)</td>
          <td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.cuda_Stream.waitEvent(</td><td class="paramname">event</td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Makes a compute stream wait on an event. </p>
</div>
</div>
<a id="a0e1d939503e8faad741ab584b720bca6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0e1d939503e8faad741ab584b720bca6">◆ </a></span>waitForCompletion()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::cuda::Stream::waitForCompletion </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>None</td><td>=</td><td>cv.cuda_Stream.waitForCompletion(</td><td class="paramname"></td><td>)</td></tr></table>
</div><div class="memdoc">
<p>Blocks the current CPU thread until all operations in the stream are complete. </p>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="af5e88420aa936b283addcc8a6233827e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5e88420aa936b283addcc8a6233827e">◆ </a></span>BufferPool</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="../../d5/d08/classcv_1_1cuda_1_1BufferPool.html">BufferPool</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="ab98d52cf0377206238fa449eebe36ab9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab98d52cf0377206238fa449eebe36ab9">◆ </a></span>DefaultDeviceInitializer</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class DefaultDeviceInitializer</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a8362b5c9fdffe61e694647684353b090"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8362b5c9fdffe61e694647684353b090">◆ </a></span>StreamAccessor</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend struct <a class="el" href="../../d6/df1/structcv_1_1cuda_1_1StreamAccessor.html">StreamAccessor</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/core/<a class="el" href="../../d8/dd1/modules_2core_2include_2opencv2_2core_2cuda_8hpp.html">cuda.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:44 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
